<template>
  <div>
    <div class="banner" @click="handleBannerClick">
      <img class="banner-img" :src="bannerImg" alt="">
      <div class="banner-info">
        <div class="banner-title">{{signtName}}</div>
        <div class="banner-number">
          <span class="iconfont banner-icon">&#xe6ee;</span>
          <span>{{number}}</span>
        </div>
      </div>
    </div>
    <common-fade>
      <common-gallary :gallaryImg="gallaryImg" v-show="showGallary" @close="handleGallaryClose"></common-gallary>
    </common-fade>
  </div>
</template>

<script>
import CommonGallary from 'common/gallary/Gallary'
import CommonFade from 'common/fade/Fade'
export default {
  name: 'DetailBanner',
  props: {
    bannerImg: String,
    gallaryImg: Array,
    signtName: String,
    number: String
  },
  components: {
    CommonGallary,
    CommonFade
  },
  data () {
    return {
      showGallary: false
    }
  },
  methods: {
    handleBannerClick () {
      this.showGallary = true
    },
    handleGallaryClose () {
      this.showGallary = false
    }
  }
}
</script>

<style lang="stylus" scoped>
  .banner
    font-size :.3rem
    overflow :hidden
    width :100%
    height: 0
    padding-bottom:55%
    background :#eee
    position :relative
    .banner-img
      width: 100%
    .banner-info
      width: 100%
      padding :.18rem .2rem
      font-size :.32rem
      color :#fff
      box-sizing :border-box
      position :absolute
      bottom: 0rem
      display :flex
      justify-content :space-between
      align-items :center
      background-image :linear-gradient(top, rgba(0,0,0,0), rgba(0,0,0,0.6))
      .banner-title
        flex :1
      .banner-number
        font-size :.24rem
        padding :.05rem .4rem
        height: .32rem
        line-height: .32rem
        border-radius :.2rem
        background :rgba(0,0,0,0.4)
        .banner-icon
          font-size .24rem
</style>
